﻿<%@ Page Title="Title" Language="C#" Inherits="System.Web.Mvc.ViewPage<Uber.WebUI.Models.AskQuestionInput>"
    MasterPageFile="~/Views/Shared/Site.Master" %>

<asp:Content runat="server" ID="Title1" ContentPlaceHolderID="TitleContent">
</asp:Content>
<asp:Content runat="server" ID="Main" ContentPlaceHolderID="MainContent">
    <script type="text/javascript">
        $(function () {
            //$(window).resize(function () { $('#Title').css('width', ($(window).width() - 197) + 'px'); }).resize();
            me.init();
            $('#body').keydown(function (e) { me.insertTab(this, e); }).keyup(rr); rr();
        });
        function rr() { $('#r').html(me.parse($('#body').val())); }
        function ab(a) {
            me.formatText(document.getElementById('body'), a);
            rr();
        }
    </script>
    

    <form method="post" action="<%=Url.Action("AskQuestion") %>">
    <%=Html.AntiForgeryToken() %>
    <div class="ext">
        <table class="et">
            <tr>
                <td style="width: 100px;">
                    <label for="Title" class="elabel">
                        Title:</label>
                </td>
                <td>
                    <div style="margin-right: 27px;"><input type="text" id="Title" name="Title" value="<%=Model.Title %>" /></div>
                </td>
            </tr>
        </table>        
        <%=Html.ValidationMessage("Title")%>
        <div class="efield" style="margin: 5px;">
            <div>
                <button type="button" onclick="ab('*');">
                    B</button>
                <button type="button" onclick="ab('_');">
                    I</button>
                <button type="button" onclick="ab('code');">
                    {code}</button>
            </div>
            <textarea id="body" name="body" rows="10" cols="20"><%=Model.Body %></textarea>
            <%=Html.ValidationMessage("Body")%>
        </div>
        <div class="efield" style="margin: 5px;">
            <input type="submit" value="Post Your Question" class="grbtn" />
            <a href='<%=Url.Action("Index") %>'>Cancel</a>
        </div>
    </div>
    
    <div class="preview" id='r'>
    </div>

    </form>
</asp:Content>
